/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jsf.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author gang
 */
@Entity
@Table(name = "document")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Document.findAll", query = "SELECT d FROM Document d")})
public class Document implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "docid")
    private Integer docid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 40)
    @Column(name = "dname")
    private String dname;
    @Size(max = 2000)
    @Column(name = "dcontent")
    private String dcontent;
    @Size(max = 20)
    @Column(name = "dauthor")
    private String dauthor;
    @Column(name = "dtime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dtime;
    @Size(max = 20)
    @Column(name = "dtype")
    private String dtype;
    @Column(name = "dstatus")
    private Boolean dstatus;
    @Size(max = 20)
    @Column(name = "dother")
    private String dother;
    @Size(max = 30)
    @Column(name = "dlink")
    private String dlink;
    @Size(max = 255)
    @Column(name = "remark")
    private String remark;

    public Document() {
    }

    public Document(Integer docid) {
        this.docid = docid;
    }

    public Document(Integer docid, String dname) {
        this.docid = docid;
        this.dname = dname;
    }

    public Integer getDocid() {
        return docid;
    }

    public void setDocid(Integer docid) {
        this.docid = docid;
    }

    public String getDname() {
        return dname;
    }

    public void setDname(String dname) {
        this.dname = dname;
    }

    public String getDcontent() {
        return dcontent;
    }

    public void setDcontent(String dcontent) {
        this.dcontent = dcontent;
    }

    public String getDauthor() {
        return dauthor;
    }

    public void setDauthor(String dauthor) {
        this.dauthor = dauthor;
    }

    public Date getDtime() {
        return dtime;
    }

    public void setDtime(Date dtime) {
        this.dtime = dtime;
    }

    public String getDtype() {
        return dtype;
    }

    public void setDtype(String dtype) {
        this.dtype = dtype;
    }

    public Boolean getDstatus() {
        return dstatus;
    }

    public void setDstatus(Boolean dstatus) {
        this.dstatus = dstatus;
    }

    public String getDother() {
        return dother;
    }

    public void setDother(String dother) {
        this.dother = dother;
    }

    public String getDlink() {
        return dlink;
    }

    public void setDlink(String dlink) {
        this.dlink = dlink;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (docid != null ? docid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Document)) {
            return false;
        }
        Document other = (Document) object;
        if ((this.docid == null && other.docid != null) || (this.docid != null && !this.docid.equals(other.docid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jsf.entity.Document[ docid=" + docid + " ]";
    }
    
}
